package com.sxkf.template.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.github.pagehelper.PageHelper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecg.common.aspect.annotation.Dict;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 用户帖子
 * </p>
 *
 * @author 杨玉龙
 * @since 2024-08-20 11:48:57
 */
@Data
@TableName("t_post")
@ApiModel(value = "Post对象", description = "用户帖子")
public class Post implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId("id")
    private String id;

    @Dict(dicCode = "id",dictTable = "t_topic",dicText = "title")
    @ApiModelProperty("话题id")
    @TableField("topic_id")
    private String topicId;

    @ApiModelProperty("发帖人id")
    @TableField("user_id")
    private String userId;

    @ApiModelProperty("手机号")
    @TableField("phone")
    private String phone;

    @ApiModelProperty(value = "类型,", notes = "1=互助赚，2=动态")
    @TableField("type")
    private String type;

    @ApiModelProperty("发帖人性别")
    @TableField("user_gender")
    private String userGender;

    @ApiModelProperty("标题")
    @TableField("title")
    private String title;

    @ApiModelProperty("图片json集合")
    @TableField("picture_json")
    private String pictureJson;

    @ApiModelProperty("视频路径")
    @TableField("video_url")
    private String videoUrl;

    @ApiModelProperty("点赞量")
    @TableField("like_count")
    private Long likeCount;

    @ApiModelProperty("收藏量")
    @TableField("collect_count")
    private Long collectCount;

    @ApiModelProperty("评论量")
    @TableField("comment_count")
    private Long commentCount;

    @ApiModelProperty("浏览量")
    @TableField("view_count")
    private Long viewCount;

    @ApiModelProperty("分享量")
    @TableField("share_count")
    private Long shareCount;

    @ApiModelProperty("状态（0=待审核，1=审核通过，2=审核不通过）")
    @TableField("state")
    private String state;

    @ApiModelProperty("开发拓展字段")
    @TableField("extension")
    private String extension;

    @ApiModelProperty(value = "经纬度")
    @TableField("jwd")
    private String jwd;

    @ApiModelProperty(value = "城市")
    @TableField("address")
    private String address;

    @ApiModelProperty("被提醒看的用户id列表")
    private String remindIds;

    @ApiModelProperty("不给看的用户id列表")
    private String disableViewIds;

    @ApiModelProperty("只给谁看的用户id列表")
    private String enableViewIds;

    @ApiModelProperty("是否收费")
    private String isCharges;

    @ApiModelProperty("查看价格")
    @TableField("charges_amount")
    private BigDecimal chargesAmount;


    @ApiModelProperty("解锁价格")
    @TableField("unlock_amount")
    private BigDecimal unlockAmount;



    @ApiModelProperty("是否删除")
    @TableField("is_delete")
    @TableLogic
    private String isDelete;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty("修改时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    public void init() {
        this.likeCount = 0L;
        this.commentCount = 0L;
        this.viewCount = 0L;
        this.shareCount = 0L;
        this.state = "0";
        this.isDelete = "0";
    }
    /*--------------------附加字段--------------------------------*/

    @ApiModelProperty(value = "是否喜欢用户")
    @TableField(exist = false)
    private Integer isLikeUser;

    @ApiModelProperty(value = "是否喜欢帖子")
    @TableField(exist = false)
    private Integer isLikePost;

    @ApiModelProperty(value = "是否收藏帖子")
    @TableField(exist = false)
    private Integer isCollectPost;

    @ApiModelProperty(value = "用户昵称")
    @TableField(exist = false)
    private String nickName;

    @ApiModelProperty("头像")
    @TableField(exist = false)
    private String avatar;

    @ApiModelProperty("性别（1=男，2=女，0=未知）")
    @TableField(exist = false)
    private String gender;

    @ApiModelProperty("年龄")
    @TableField(exist = false)
    private Integer age;

    @ApiModelProperty(value = "距离（单位km）")
    @TableField(exist = false)
    private Double distance;

    @ApiModelProperty(value = "是否解锁帖子（当帖子收费时判断）")
    @TableField(exist = false)
    private Boolean isUnlock;

    @ApiModelProperty("话题标题")
    @TableField(exist = false)
    private String topicTitle;

//    @ApiModelProperty("图片链接")
//    @TableField(exist = false)
//    private List<String> pictures;
}
